package main
import (
	"fmt"
	"time"
)

func main(){

	time1 := time.NewTimer(2 * time.Second)

	fmt.Println("we can doing anything we want")

	<-time1.C // bolck 2s
	fmt.Println("2s gone...")

	// cancel the waitting
	time2 := time.NewTimer(time.Second)
	go func() {
		<-time2.C
		fmt.Println("time2 fired")
	}()
	stop2 := time2.Stop()
	if stop2 {
		fmt.Println("time2 stoped")
	}

	time.Sleep(time.Second * 2)


}